package com.infore.gateway.main.controller;

import com.infore.gateway.main.model.ApiResponse;
import com.infore.gateway.main.enums.BaseError;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Discription TODO
 * @Autor lijh
 * @Date 2020/7/14 14:22
 */
@RestController
@RequestMapping("/gateway")
@Slf4j
public class DefaultHystrixController {

    @RequestMapping("/defaultFallback")
    public ApiResponse defaultFallback(){
        log.error("=========={}========",BaseError.API_NOT_AVAILABLE.getMsg());
        return ApiResponse.error(BaseError.API_NOT_AVAILABLE);
    }

    @RequestMapping("/electricServerFallback")
    public ApiResponse stenchServerFallback(){
        log.error("=========={}========",BaseError.STENCH_API_NOT_AVAILABLE.getMsg());
        return ApiResponse.error(BaseError.STENCH_API_NOT_AVAILABLE);
    }
    @RequestMapping("/quartzServerFallback")
    public ApiResponse quartzServerFallback(){
        log.error("=========={}========",BaseError.QUARTZ_API_NOT_AVAILABLE.getMsg());
        return ApiResponse.error(BaseError.QUARTZ_API_NOT_AVAILABLE);
    }

}
